package com.banmoon.singleton;

/**
 * 懒汉式（线程安全，同步方法）
 */
public class Singleton04 {

    private Singleton04() {
    }

    private static Singleton04 instance;

    public static synchronized Singleton04 getInstance(){
        if(instance==null)
            instance = new Singleton04();
        return instance;
    }

}
